// 导入组件
import Vue from 'vue'
import Router from 'vue-router'
// 登录
import login from '@/views/login'
// 首页
import index from '@/views/index'
// 图表界面
import statistics from '@/views/charts/statistics'

// 用户管理
import UsersManage from '@/views/user/UsersManage'
import Students from '@/views/user/Students'
import Teachers from '@/views/user/Teachers'

// 网页管理
import News from '@/views/Content/News'
import Papers from '@/views/Content/Papers'
import Patents from '@/views/Content/Patents'
import Achievements from '@/views/Content/Achievements'
import StudentHonors from '@/views/Content/StudentHonors'
import StudentProjects from '@/views/Content/StudentProjects'

// 启用路由
Vue.use(Router)

// 导出路由
export default new Router({
  routes: [
    {
      path: '/',
      name: '',
      component: login,
      hidden: true,
      meta: {
        requireAuth: false,
      },
    }, {
      path: '/login',
      name: '登录',
      component: login,
      hidden: true,
      meta: {
        requireAuth: false,
      },
    }, {
      path: '/index',
      name: '首页',
      component: index,
      iconCls: 'el-icon-tickets',
      children: [
        {
          path: '/charts/statistics',
          name: '数据可视化',
          component: statistics,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/user/students',
          name: '学生管理',
          component: Students,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/user/teachers',
          name: '教师管理',
          component: Teachers,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/user/users',
          name: '用户管理',
          component: UsersManage,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/content/news',
          name: '新闻管理',
          component: News,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/content/paper',
          name: '文章管理',
          component: Papers,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/content/achievement',
          name: '荣誉管理',
          component: Achievements,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/content/student/honor',
          name: '学生荣誉管理',
          component: StudentHonors,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/content/student/project',
          name: '学生项目管理',
          component: StudentProjects,
          meta: {
            requireAuth: true,
          },
        }, {
          path: '/content/patent',
          name: '专利管理',
          component: Patents,
          meta: {
            requireAuth: true,
          },
        },
      ],
    }],
})
